package com.imooc.newretail.common.vo;

/**
 * @program:new-retail-teach
 * @description:返回视图对象的工具类
 * @author:Hank.He
 * @create:2020-06-25 22:15
 **/
public class RV<T> {

    /***
     * 成功的返回对象
     * @param data
     * @return
     */
    public static ResultVO success(Object data) {
        ResultVO resultVO = new ResultVO(data);
        resultVO.setCode(ResultVO.SUCCESS);
        return resultVO;
    }

    /****
     * 失败的返回对象
     * @param msg
     * @return
     */
    public static ResultVO fail(String msg) {
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(ResultVO.FAIL);
        resultVO.setMsg(msg);
        return resultVO;
    }
}
